home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks97 / WarriorsProgress.sit / Warrior’s Progress / source code / Source / Libraries / Announcer / Announcing.h < prev    next >
Text File  |  1997-06-28  |  596b  |  36 lines

  1. // Announcing.h
  2.  
  3. #ifndef Announcing_h
  4. #define Announcing_h
  5.  
  6. #ifndef Announcer_h
  7. #include "Announcer.h"
  8. #endif
  9.  
  10. template < class ValueType > class Modifier;
  11.  
  12. template < class ValueType >
  13. class Announcing: public Announcer
  14.   {
  15.     friend class Modifier< ValueType >;
  16.     
  17.     private:
  18.         ValueType value;
  19.     
  20.     public:
  21.         Announcing( const ValueType& initialValue )
  22.           : value( initialValue )
  23.           {}
  24.         
  25.         operator const ValueType&() const    { return value; }
  26.         const ValueType& Value() const        { return value; }
  27.         
  28.         void operator=( const ValueType& );
  29.           {
  30.             value = newValue;
  31.             Announce();
  32.           }
  33.   };
  34.  
  35. #endif
  36.